package com.lagou.homework.dao;

import com.lagou.homework.pojo.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

public interface UserDao extends JpaRepository<User,Integer> {
    @Query(value = "select count(*) from user where email = ?1",nativeQuery = true)
    public Long findBySql(String email);

    @Query(value = "select count(*) from user where email = ?1 and password = ?2",nativeQuery = true)
    public Long validateSql(String email, String password);
}
